/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * editemployee.java
 *
 * Created on Mar 14, 2013, 3:35:57 PM
 */
package employeepayrollsystem;

import java.awt.Font;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Jalaj
 */
public class editemployee extends javax.swing.JPanel {

    /** Creates new form editemployee */
    public editemployee() {
        initComponents();
        setVisible(true);
        String q = "SELECT enm,add1,add2,add3,city,jdat,rdat,phn1,phn2,mob,did,ctid,ptyp,wage,remk from emp WHERE eid=1";
                  ResultSet rst=db.exexutequery(q);
                  try{
                      while(rst.next())
                      {   
                          name.setText(rst.getString(1));
                          address1.setText(rst.getString(2));
                          address2.setText(rst.getString(3));
                          address3.setText(rst.getString(4));
                          city.setText(rst.getString(5));
                          phone1.setText(rst.getString(8));
                          phone2.setText(String.valueOf(rst.getInt(9)));
                          java.sql.Date d=null;
                          
                          
                          jDateChooser1.setDate(rst.getDate(6));
                          
                          
                          if((rst.getDate(7)).equals(d))
                          {
                              System.out.println("jalaj");
                              jLabel10.setVisible(false);
                              jDateChooser2.setVisible(false);
                              
                          }
                      }
                  }
                  catch(SQLException e){System.out.println("wtf");}
                  
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jLabel26 = new javax.swing.JLabel();
        itemcombo = new javax.swing.JComboBox();
        jLabel25 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jSeparator1 = new javax.swing.JSeparator();
        cancel = new javax.swing.JButton();
        mobile = new javax.swing.JTextField();
        submit = new javax.swing.JButton();
        departmentcombo = new javax.swing.JComboBox();
        rateitem = new javax.swing.JTextField();
        phone1 = new javax.swing.JTextField();
        jSeparator3 = new javax.swing.JSeparator();
        phone2 = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel15 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        additem = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel1 = new javax.swing.JLabel();
        categorycombo = new javax.swing.JComboBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel21 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        jLabel3 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel24 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        address1 = new javax.swing.JTextField();
        itemradio = new javax.swing.JRadioButton();
        address2 = new javax.swing.JTextField();
        fixedradio = new javax.swing.JRadioButton();
        address3 = new javax.swing.JTextField();
        dailyradio = new javax.swing.JRadioButton();
        city = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        wagefixed = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jLabel17 = new javax.swing.JLabel();
        wagedaily = new javax.swing.JTextField();
        name = new javax.swing.JTextField();
        jDateChooser1 = new com.toedter.calendar.JDateChooser();
        jLabel19 = new javax.swing.JLabel();
        jDateChooser2 = new com.toedter.calendar.JDateChooser();

        setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(employeepayrollsystem.EmployeePayrollSystemApp.class).getContext().getResourceMap(editemployee.class);
        jLabel26.setFont(resourceMap.getFont("jLabel26.font")); // NOI18N
        jLabel26.setText(resourceMap.getString("jLabel26.text")); // NOI18N
        jLabel26.setName("jLabel26"); // NOI18N
        add(jLabel26, new org.netbeans.lib.awtextra.AbsoluteConstraints(263, 498, -1, -1));

        itemcombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        itemcombo.setName("itemcombo"); // NOI18N
        add(itemcombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(52, 497, 143, -1));

        jLabel25.setFont(resourceMap.getFont("jLabel25.font")); // NOI18N
        jLabel25.setText(resourceMap.getString("jLabel25.text")); // NOI18N
        jLabel25.setName("jLabel25"); // NOI18N
        add(jLabel25, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 498, -1, -1));

        jLabel9.setFont(resourceMap.getFont("jLabel9.font")); // NOI18N
        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N
        add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(440, 190, -1, -1));

        jLabel8.setFont(resourceMap.getFont("jLabel8.font")); // NOI18N
        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N
        add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 147, -1, -1));

        jLabel7.setFont(resourceMap.getFont("jLabel7.font")); // NOI18N
        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N
        add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 104, -1, -1));

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator1.setName("jSeparator1"); // NOI18N
        add(jSeparator1, new org.netbeans.lib.awtextra.AbsoluteConstraints(389, 46, -1, 268));

        cancel.setText(resourceMap.getString("cancel.text")); // NOI18N
        cancel.setName("cancel"); // NOI18N
        add(cancel, new org.netbeans.lib.awtextra.AbsoluteConstraints(745, 449, 141, -1));

        mobile.setName("mobile"); // NOI18N
        add(mobile, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 190, 160, -1));

        submit.setText(resourceMap.getString("submit.text")); // NOI18N
        submit.setName("submit"); // NOI18N
        submit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                submitActionPerformed(evt);
            }
        });
        add(submit, new org.netbeans.lib.awtextra.AbsoluteConstraints(745, 408, 141, -1));

        departmentcombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        departmentcombo.setName("departmentcombo"); // NOI18N
        add(departmentcombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 233, 160, -1));

        rateitem.setName("rateitem"); // NOI18N
        add(rateitem, new org.netbeans.lib.awtextra.AbsoluteConstraints(301, 497, 147, -1));

        phone1.setName("phone1"); // NOI18N
        add(phone1, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 104, 160, -1));

        jSeparator3.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator3.setName("jSeparator3"); // NOI18N
        add(jSeparator3, new org.netbeans.lib.awtextra.AbsoluteConstraints(733, 0, -1, 546));

        phone2.setName("phone2"); // NOI18N
        add(phone2, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 147, 160, -1));

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N
        add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(298, 106, -1, 17));

        jLabel10.setFont(resourceMap.getFont("jLabel10.font")); // NOI18N
        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N
        add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 233, -1, -1));

        jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
        jLabel15.setName("jLabel15"); // NOI18N
        add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(298, 149, -1, 17));

        jLabel11.setFont(resourceMap.getFont("jLabel11.font")); // NOI18N
        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N
        add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(420, 276, -1, -1));

        additem.setText(resourceMap.getString("additem.text")); // NOI18N
        additem.setName("additem"); // NOI18N
        add(additem, new org.netbeans.lib.awtextra.AbsoluteConstraints(470, 497, -1, -1));

        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N
        add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(298, 66, -1, -1));

        jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
        jLabel13.setForeground(resourceMap.getColor("jLabel13.foreground")); // NOI18N
        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N
        add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(304, 11, -1, -1));

        jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N
        add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(76, 68, -1, -1));

        categorycombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
        categorycombo.setName("categorycombo"); // NOI18N
        add(categorycombo, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 276, 160, -1));

        jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N
        add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(30, 280, -1, -1));

        jLabel21.setFont(resourceMap.getFont("jLabel21.font")); // NOI18N
        jLabel21.setText(resourceMap.getString("jLabel21.text")); // NOI18N
        jLabel21.setName("jLabel21"); // NOI18N
        add(jLabel21, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 347, -1, -1));

        jSeparator2.setName("jSeparator2"); // NOI18N
        add(jSeparator2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 327, 717, -1));

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N
        add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(62, 151, -1, -1));

        jLabel2.setFont(resourceMap.getFont("jLabel2.font")); // NOI18N
        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N
        add(jLabel2, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 107, -1, -1));

        jLabel5.setFont(resourceMap.getFont("jLabel5.font")); // NOI18N
        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N
        add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(81, 239, -1, -1));

        jLabel24.setText(resourceMap.getString("jLabel24.text")); // NOI18N
        jLabel24.setName("jLabel24"); // NOI18N
        add(jLabel24, new org.netbeans.lib.awtextra.AbsoluteConstraints(670, 190, -1, 17));

        jLabel4.setFont(resourceMap.getFont("jLabel4.font")); // NOI18N
        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N
        add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(62, 195, -1, -1));

        jLabel18.setText(resourceMap.getString("jLabel18.text")); // NOI18N
        jLabel18.setName("jLabel18"); // NOI18N
        add(jLabel18, new org.netbeans.lib.awtextra.AbsoluteConstraints(298, 278, -1, 17));

        address1.setName("address1"); // NOI18N
        add(address1, new org.netbeans.lib.awtextra.AbsoluteConstraints(134, 104, 160, -1));

        itemradio.setText(resourceMap.getString("itemradio.text")); // NOI18N
        itemradio.setName("itemradio"); // NOI18N
        add(itemradio, new org.netbeans.lib.awtextra.AbsoluteConstraints(340, 450, -1, -1));

        address2.setName("address2"); // NOI18N
        add(address2, new org.netbeans.lib.awtextra.AbsoluteConstraints(134, 147, 160, -1));

        fixedradio.setText(resourceMap.getString("fixedradio.text")); // NOI18N
        fixedradio.setName("fixedradio"); // NOI18N
        add(fixedradio, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 381, -1, -1));

        address3.setName("address3"); // NOI18N
        add(address3, new org.netbeans.lib.awtextra.AbsoluteConstraints(134, 190, 160, -1));

        dailyradio.setText(resourceMap.getString("dailyradio.text")); // NOI18N
        dailyradio.setName("dailyradio"); // NOI18N
        add(dailyradio, new org.netbeans.lib.awtextra.AbsoluteConstraints(477, 381, -1, -1));

        city.setName("city"); // NOI18N
        add(city, new org.netbeans.lib.awtextra.AbsoluteConstraints(134, 233, 160, -1));

        jLabel22.setFont(resourceMap.getFont("jLabel22.font")); // NOI18N
        jLabel22.setText(resourceMap.getString("jLabel22.text")); // NOI18N
        jLabel22.setName("jLabel22"); // NOI18N
        add(jLabel22, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 415, -1, -1));

        wagefixed.setName("wagefixed"); // NOI18N
        add(wagefixed, new org.netbeans.lib.awtextra.AbsoluteConstraints(52, 414, 160, -1));

        jLabel16.setText(resourceMap.getString("jLabel16.text")); // NOI18N
        jLabel16.setName("jLabel16"); // NOI18N
        add(jLabel16, new org.netbeans.lib.awtextra.AbsoluteConstraints(298, 192, -1, 17));

        jLabel23.setFont(resourceMap.getFont("jLabel23.font")); // NOI18N
        jLabel23.setText(resourceMap.getString("jLabel23.text")); // NOI18N
        jLabel23.setName("jLabel23"); // NOI18N
        add(jLabel23, new org.netbeans.lib.awtextra.AbsoluteConstraints(479, 413, -1, -1));

        jLabel17.setText(resourceMap.getString("jLabel17.text")); // NOI18N
        jLabel17.setName("jLabel17"); // NOI18N
        add(jLabel17, new org.netbeans.lib.awtextra.AbsoluteConstraints(298, 235, -1, 17));

        wagedaily.setName("wagedaily"); // NOI18N
        add(wagedaily, new org.netbeans.lib.awtextra.AbsoluteConstraints(521, 412, 160, -1));

        name.setName("name"); // NOI18N
        add(name, new org.netbeans.lib.awtextra.AbsoluteConstraints(134, 66, 160, -1));

        jDateChooser1.setName("jDateChooser1"); // NOI18N
        add(jDateChooser1, new org.netbeans.lib.awtextra.AbsoluteConstraints(134, 276, 160, -1));

        jLabel19.setFont(resourceMap.getFont("jLabel19.font")); // NOI18N
        jLabel19.setText(resourceMap.getString("jLabel19.text")); // NOI18N
        jLabel19.setName("jLabel19"); // NOI18N
        add(jLabel19, new org.netbeans.lib.awtextra.AbsoluteConstraints(400, 70, 100, -1));

        jDateChooser2.setName("jDateChooser2"); // NOI18N
        add(jDateChooser2, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 66, 160, -1));
    }// </editor-fold>//GEN-END:initComponents

    private void submitActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitActionPerformed
        // TODO add your handling code here:
        String nm=name.getText();
        String add1s=address1.getText();
        String add2s=address2.getText();
        String add3s=address3.getText();
        String citys=city.getText();
        //String jdates=jDateChooser1.getDate();
        String phone1s=phone1.getText();
        String phone2s=phone2.getText();
        String mobiles=mobile.getText();
        String deps=departmentcombo.getSelectedItem().toString();
        String cats=categorycombo.getSelectedItem().toString();
}//GEN-LAST:event_submitActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton additem;
    private javax.swing.JTextField address1;
    private javax.swing.JTextField address2;
    private javax.swing.JTextField address3;
    private javax.swing.JButton cancel;
    private javax.swing.JComboBox categorycombo;
    private javax.swing.JTextField city;
    private javax.swing.JRadioButton dailyradio;
    private javax.swing.JComboBox departmentcombo;
    private javax.swing.JRadioButton fixedradio;
    private javax.swing.JComboBox itemcombo;
    private javax.swing.JRadioButton itemradio;
    private com.toedter.calendar.JDateChooser jDateChooser1;
    private com.toedter.calendar.JDateChooser jDateChooser2;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    private javax.swing.JSeparator jSeparator3;
    private javax.swing.JTextField mobile;
    private javax.swing.JTextField name;
    private javax.swing.JTextField phone1;
    private javax.swing.JTextField phone2;
    private javax.swing.JTextField rateitem;
    private javax.swing.JButton submit;
    private javax.swing.JTextField wagedaily;
    private javax.swing.JTextField wagefixed;
    // End of variables declaration//GEN-END:variables

}
